// 获取工程师列表
function getEngineer(id,url){
    $.ajax({
        url: '/weixin/allocation/engineer',
        method:'get',
        dataType:'json',
        async:false,
        success:function(result){
            if(result.code=='0'){
                renderSelect(result.data,id,url);
            }else{
                showErrorToast(result.msg);
            }
        },
        error: function (result) {
            showErrorToast("获取工程师列表报错");
        }
    });
}
function  showErrorToast(errMsg) {
    var $toast = $('#toast');
    if ($toast.css('display') != 'none') return;
    $toast.find('p').html(null);
    $toast.find('p').html(errMsg);
    $toast.fadeIn(100);
    setTimeout(function () {
        $toast.fadeOut(100);
    }, 2000);
}
function  showSuccessToast(msg) {
    var $toast = $('#toast_success');
    if ($toast.css('display') != 'none') return;
    $toast.find('p').html(null);
    $toast.find('p').html(msg);
    $toast.fadeIn(100);
    setTimeout(function () {
        $toast.fadeOut(200);
    }, 2000);
}

function update(json,callback) {
    $.ajax({
        url:'/weixin/allocation/update',
        type : 'POST',
        data:json,
        success:function () {
            if(callback !=null){
                callback();
            }

        }
    });
}